<script type="text/javascript">
function getfiled(id){
	loadURLWithTip('/${orgi}/dm/cube/tablefield/'+$('#'+id).find('option:selected').attr('data-id')+'.html','#tablefield',null,false);
}
</script>
<div class="artCon" id ="artCon">
	<div class="middleArt">
	<form class="form-horizontal" id="mainForm" action="/${orgi}/dm/cube/${cube.id}/dimensionaddo.html" data-toggle="form" method="post">
		<div class="artMain">
			<div class="mainCenter"> 
			
			<table class="data_table_1" style="margin-left: 10px;">
					<tr>
						<th>维度名称：</th>
						<td><input type="text" value="" class="span2" name="name" required="">
						 <span class="help-inline"></span><i class="inputip">*</i>
						</td>
						<th>权限控制：</th>
						<td>
						<label class="radio inline"><input type="radio" value="1" name="postop">是</label>
						<label class="radio inline"><input type="radio" checked="checked" value="0" name="postop">否</label>
						</td>
					</tr>
					<tr>
						<th>维度类型：</th>
						<td>
							<select name="type" class="span2">
								<option value="">默认</option>
								<option value="TimeDimension">TimeDimension</option>
							</select>
						</td>
						<th>汇总名称：</th>
						<td><input type="text" name="allmembername" id="prependedInput" maxlength="200" value="合计" required="" class="span2"></td>
					</tr>
					<tr>
						<th>参数：</th>
						<td colspan="3"><input type="text" name="parameters" id="parameters" maxlength="200" value="" class="span2" style="width:485px;" >
						</td>
					</tr>
					<tr>
						<th>属性：</th>
						<td colspan="3">
						<textarea name="attribue" maxlength="255"
								style="width:485px; height:110px; resize:none;"></textarea>
						</td>

					</tr>
					<tr>
						<th>主表外键：</th>
						<td colspan="3"><select name="fkfield" class="span2" style="width:493px;">
							<option value="">无关联外键</option>
							<#if cube?? && cube.metadata??>
								<#list cube.metadata as meta>
									<#if meta.mtype?? && meta.mtype == "0">
										<#list meta.tb.tableproperty as tp>
											<option value="${tp.fieldname!''}">${tp.name!''}</option>
										</#list>
									</#if>
								</#list>
							</#if>
						</select>
						</td>
					</tr>
					<tr>
						<th>关联子表：</th>
						<td>
						<select onchange="getfiled('tablecd')" name="fktable" class="span2" id="tablecd">
						<option value="">点击选择关联子表</option>
						<#if cube?? && cube.metadata??>
								<#list cube.metadata as meta>
									<#if meta.mtype?? && meta.mtype == "0">
									<#else>
										<option <#if name??&&name==meta.tb.tablename>selected="selected"</#if> value="${meta.tb.tablename!''}" data-id='${meta.tb.id}'>${meta.tb.tablename!''}</option>
									</#if>
								</#list>
							</#if>
						</select>
						</td>
						<th>子表字段：</th>
						<td colspan="3" class="span2">
							<div id="tablefield">
								<#include 'tplist.html'/>
							</div>
						</td>
					</tr>
				</table>
			
			</div>
		</div>
		<div class="bottomBg">
			<div class="btnWrap">
				<input type="submit" class="subButtonStyle" value="确认"/>
				<input type="button" onclick="closeR3ArtDialog()" class="cancelButtonStyle" value="取消"/>
			</div>
		</div>
	</form>
	</div>
</div>
